/*
*
*  AfterlifeServer_market_initalize.sqf
*  Author: WolfkillArcadia
*  © 2016 Arcas Industries
*  This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
*  To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
*/
private["_listings", "_deleteTime"];

_deleteTime = 3; //上市物品有效期 (天)

"正在清理过期上市物品..." call AfterlifeServer_util_log;
format ["deleteOldListings:%1", _deleteTime] call ExileServer_system_database_query_fireAndForget;

"正在加载拍卖行上市物品..." call AfterlifeServer_util_log;
_listings = format ["getListings"] call ExileServer_system_database_query_selectFull;

if !(count(_listings) isEqualTo 0) then
{
    AfterlifeListing = [_listings, [], {(_x select 2) select 0}, "DESCEND"] call BIS_fnc_sortBy;
    "拍卖列表加载完成" call AfterlifeServer_util_log;
}
else
{
    "拍卖列表加载完成, 无物品" call AfterlifeServer_util_log;
};
